<template>
  <p-modal
    :title="title"
    :width="width"
    :visible="visible"
    :confirmLoading="confirmLoading"
    @ok="handleOk"
    @cancel="handleCancel"
    cancelText="关闭"
  >
    <p-spin :spinning="confirmLoading">
      <p-form-model :model="form" ref="formRules" :rules="rules">
        <p-row>
          <p-col :span="24">
            <p-form-model-item
              label="提前结束老化原因"
              :labelCol="labelCol"
              :wrapperCol="wrapperCol"
              prop="earlyEndAgingReason"
            >
              <p-input
                placeholder="请输入结束原因"
                v-model.trim="form.earlyEndAgingReason"
              ></p-input>
            </p-form-model-item>
          </p-col>
        </p-row>
      </p-form-model>
    </p-spin>
  </p-modal>
</template>

<script>
import { httpAction, putAction, api } from "@/api/manage";
import { SubmitOnchangMixin } from "@/mixins/SubmitOnchangMixin";
import pick from "lodash.pick";
import { validateDuplicateValue } from "@/utils/util";
export default {
  name: "",
  mixins: [SubmitOnchangMixin],
  data() {
    return {
      form: {
        earlyEndAgingReason: "",
      },
      width: 800,
      visible: false,
      confirmLoading: false,
      labelCol: {
        xs: { span: 24 },
        sm: { span: 5 },
      },
      wrapperCol: {
        xs: { span: 24 },
        sm: { span: 16 },
      },
      url: {},
      rules: {
        earlyEndAgingReason: [
          { required: true, message: "请填写提前结束原因", trigger: "blur" },
        ],
      },
    };
  },
  methods: {
    edit(record) {
      this.visible = true;
    },
    close() {
      this.visible = false;
    },
    handleOk() {
      if (this.form.earlyEndAgingReason) {
        this.$emit("endOking", this.form.earlyEndAgingReason);
      } else {
        this.$message.warning("未填写结束老化原因");
      }
    },
    handleCancel() {
      this.close();
    },
  },
};
</script>

<style lang='scss' scoped>
</style>
